package com.bangyo.file;

import java.io.Serializable;

import org.sothis.util.ObjectUtils;

public enum Purpose implements Serializable
{
    AVATAR("avatar"), ATTACHMENT("attachment");

    private String purpose = null;

    private Purpose(String purpose)
    {
        this.purpose = purpose;
    }

    public String getPurpose()
    {
        return purpose;
    }

    public static Purpose toPurpose(String purpose)
    {
        for (Purpose _purpose:Purpose.values())
        {
            if (ObjectUtils.equal(_purpose.getPurpose(), purpose))
            {
                return _purpose;
            }
        }
        return null;
    }

    @Override
    public String toString()
    {
        return this.purpose;
    }
}
